.class public Lrexsee/barcode/RexseeBarcode;
.super Ljava/lang/Object;
.source "RexseeBarcode.java"

# interfaces
.implements Lrexsee/core/browser/clazz/JavascriptInterface;


# static fields
.field public static final EVENT_ONBARCODESCANFAILED:Ljava/lang/String; = "onBarcodeScanFailed"

.field public static final EVENT_ONBARCODESCANSUCCESSED:Ljava/lang/String; = "onBarcodeScanSuccessed"

.field private static final INTERFACE_NAME:Ljava/lang/String; = "Barcode"


# instance fields
.field private final mBrowser:Lrexsee/core/browser/Browser;


# direct methods
.method public constructor <init>(Lrexsee/core/browser/Browser;)V
    .locals 2
    .param p1, "browser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 31
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 32
    iput-object p1, p0, Lrexsee/barcode/RexseeBarcode;->mBrowser:Lrexsee/core/browser/Browser;

    .line 33
    iget-object v0, p1, Lrexsee/core/browser/Browser;->eventList:Lrexsee/core/browser/clazz/EventList;

    const-string v1, "onBarcodeScanSuccessed"

    invoke-virtual {v0, v1}, Lrexsee/core/browser/clazz/EventList;->add(Ljava/lang/String;)V

    .line 34
    iget-object v0, p1, Lrexsee/core/browser/Browser;->eventList:Lrexsee/core/browser/clazz/EventList;

    const-string v1, "onBarcodeScanFailed"

    invoke-virtual {v0, v1}, Lrexsee/core/browser/clazz/EventList;->add(Ljava/lang/String;)V

    .line 35
    return-void
.end method

.method static synthetic access$0(Lrexsee/barcode/RexseeBarcode;)Lrexsee/core/browser/Browser;
    .locals 1

    .prologue
    .line 29
    iget-object v0, p0, Lrexsee/barcode/RexseeBarcode;->mBrowser:Lrexsee/core/browser/Browser;

    return-object v0
.end method


# virtual methods
.method public getInheritInterface(Lrexsee/core/browser/Browser;)Lrexsee/core/browser/clazz/JavascriptInterface;
    .locals 0
    .param p1, "childBrowser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 19
    return-object p0
.end method

.method public getInterfaceName()Ljava/lang/String;
    .locals 2

    .prologue
    .line 15
    new-instance v0, Ljava/lang/StringBuilder;

    iget-object v1, p0, Lrexsee/barcode/RexseeBarcode;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v1, v1, Lrexsee/core/browser/Browser;->application:Lrexsee/core/application/RexseeApplication;

    iget-object v1, v1, Lrexsee/core/application/RexseeApplication;->resources:Lrexsee/core/application/Resource;

    iget-object v1, v1, Lrexsee/core/application/Resource;->prefix:Ljava/lang/String;

    invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v1, "Barcode"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getNewInterface(Lrexsee/core/browser/Browser;)Lrexsee/core/browser/clazz/JavascriptInterface;
    .locals 1
    .param p1, "childBrowser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 23
    new-instance v0, Lrexsee/barcode/RexseeBarcode;

    invoke-direct {v0, p1}, Lrexsee/barcode/RexseeBarcode;-><init>(Lrexsee/core/browser/Browser;)V

    return-object v0
.end method

.method public start(ZZZ)V
    .locals 9
    .param p1, "beep"    # Z
    .param p2, "vibrate"    # Z
    .param p3, "flash"    # Z

    .prologue
    .line 39
    :try_start_0
    new-instance v2, Lrexsee/barcode/RexseeBarcode$1;

    invoke-direct {v2, p0}, Lrexsee/barcode/RexseeBarcode$1;-><init>(Lrexsee/barcode/RexseeBarcode;)V

    .line 49
    .local v2, "onScanSuccessed":Lrexsee/barcode/BarcodeCaptureDialog$OnScanSuccessed;
    new-instance v0, Lrexsee/barcode/BarcodeCaptureDialog;

    iget-object v1, p0, Lrexsee/barcode/RexseeBarcode;->mBrowser:Lrexsee/core/browser/Browser;

    move v3, p1

    move v4, p2

    move v5, p3

    invoke-direct/range {v0 .. v5}, Lrexsee/barcode/BarcodeCaptureDialog;-><init>(Lrexsee/core/browser/Browser;Lrexsee/barcode/BarcodeCaptureDialog$OnScanSuccessed;ZZZ)V

    .line 50
    .local v0, "dialog":Lrexsee/barcode/BarcodeCaptureDialog;
    invoke-virtual {v0}, Lrexsee/barcode/BarcodeCaptureDialog;->startDialog()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 54
    .end local v0    # "dialog":Lrexsee/barcode/BarcodeCaptureDialog;
    .end local v2    # "onScanSuccessed":Lrexsee/barcode/BarcodeCaptureDialog$OnScanSuccessed;
    :goto_0
    return-void

    .line 51
    :catch_0
    move-exception v1

    move-object v6, v1

    .line 52
    .local v6, "e":Ljava/lang/Exception;
    iget-object v1, p0, Lrexsee/barcode/RexseeBarcode;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v1, v1, Lrexsee/core/browser/Browser;->eventList:Lrexsee/core/browser/clazz/EventList;

    const-string v3, "onBarcodeScanFailed"

    const/4 v4, 0x1

    new-array v4, v4, [Ljava/lang/String;

    const/4 v5, 0x0

    new-instance v7, Ljava/lang/StringBuilder;

    const-string v8, "Exception:"

    invoke-direct {v7, v8}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v6}, Ljava/lang/Exception;->getLocalizedMessage()Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v7

    invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v7

    aput-object v7, v4, v5

    invoke-virtual {v1, v3, v4}, Lrexsee/core/browser/clazz/EventList;->run(Ljava/lang/String;[Ljava/lang/String;)V

    goto :goto_0
.end method
